Using state transitions

Use state transitions to define how the state manager reacts when the application state changes, such as when the user clicks a button. For example, you can:

Setting transitions between any to any state

When you create states the state manager uses the default transition to transition between states.

To set transitions between any to any state:

  1. Create a node and set the node to use a state manager. See Using state managers or Tutorial: Creating a toggle button.
    For example, create a toggle button and a state manager that has one state group with the states On and Off.
  2. In the State Tools click Transition Editor to open the State Transition Editor.
    To create a new transition, click + Create Transition under the existing transitions.
  3. When you first open the State Transition Editor it shows the transition that is used between all states in that state group. Move your mouse pointer over to see the details of the transition.
  4. In the popup window set:

Setting transitions between specific states

You can set custom transitions between specific states. You can add states to the State Transition Editor canvas and configure transition settings between them.

To set transitions between specific states:

  1. Right-click in the State Transition Editor and in the Add State To Canvas select the state for which you want to set the transitions.
    To show all states, click Add All States To Canvas.
  2. Click the state to select it and click the Default transitions to set a Custom transition.
  3. Move your mouse pointer over the transitions to see the details of the transitions.
    The State Tools shows you the transitions you define in the State Transition Editor. Click a transition to open the custom settings for that transition in the State Transition Editor.

Using custom easing functions in state transitions

You can use animations to define custom easing functions for transitions between states. For example, define a custom easing function to make a phone call alert blink when you enter that state.

To use custom easing functions in state transitions:

  1. Create or select a node that uses a state manager. See Using state managers or Tutorial: Creating a toggle button.
    For example:
    1. Create an Image node that shows the image that alerts the user about an incoming phone call.

    2. Create for the Image node a state manager that has one state group with the states Default and Incoming Call, and add and set the value of the Opacity property of the Image node for each state:
      • For the Default state set it to 0
        This way you hide the incoming call image in the Default state when the phone is not ringing.
      • For the Incoming Call state set it to 1
        This way you show the incoming call image in the Incoming Call state when the phone is ringing.
  2. Create an Animation or Animation Clip resource. You use this animation to change the value of the property that you use in the states which you created in the previous step. See Creating keyframe animations.
    For example, in the Library > Animations > Animation Data create an Animation that animates the Opacity property of a node. You use this animation to make the node blink three times when the node enters the Incoming Call state.
  3. In the Project select the node that you created in the first step and in the State Tools click Any -> Any to open the State Transition Editor.
  4. In the State Transition Editor set:
  5. At the bottom of the State Transition Editor click to add a transition animation and in the Transition Animations set:
  6. To play the transition animation in the Preview, in the State Tools click next to the transition.

Configuring easing functions

You can configure some of the easing functions in the State Transition Editor to define the values in the function that sets the transition curve.

The easing functions you can configure in the State Transition Editor are:

See also

State manager

Using state managers

Tutorial: Creating a toggle button

Using the Button nodes

Creating keyframe animations